﻿using System;

namespace enyo
{
    public class Component : enyo.Object
    {
        public enyo.Object[] Components;

        [ImportMember("$")]
        public enyo.Object _;

        public Component Owner { get; set; }
        public string Name { get; set; }

        /// <summary>
        /// When a Component is instantiated, and after all constructors are executed, the create method is invoked. During Component.create, all owned Components are created.
        /// </summary>
        public virtual void Create()
        {
        }

        /// <summary>
        /// Calling destroy on a component will remove it from all framework bookkeeping, and in particular will set owner to NULL. 
        /// </summary>
        public virtual void Destroy()
        {
        }

        public virtual void InitComponents()
        {
        }

        public Component CreateComponent(object createInfo, object moreInfo)
        {
            return null;
        }

        public Component[] CreateComponents(object[] createInfo, object moreInfo)
        {
            return null;
        }

        /// <summary>
        /// Destroys all owned components.
        /// </summary>
        public void DestroyComponents()
        {
        }

        /// <summary>
        /// Returns an Array of owned components. In other words, converts the $ hash into an array and returns the array.
        /// </summary>
        /// <returns></returns>
        public object[] GetComponents()
        {
            return null;
        }
    }
}
